import request from "@/utils/request"
/* 此部分为在SpuForm组件中的sku操作 */
// 获取图片列表 /admin/product/spuImageList/{spuId} get
export const reqGetSpuImageList = (spuId) => {
  return request({
    url: `/admin/product/spuImageList/${spuId}`,
    method: "get",
  })
}
// 获取销售属性 /admin/product/spuSaleAttrList/{spuId} get
export const reqGetSpuSaleAttrList = (spuId) => {
  return request({
    url: `/admin/product/spuSaleAttrList/${spuId}`,
    method: "get",
  })
}
// 平台属性的获取 /admin/product/attrInfoList/{category1Id}/{category2Id}/{category3Id} get
export const reqGetAttrInfoList = (category1Id, category2Id, category3Id) => {
  return request({
    url: `/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`,
    method: "get",
  })
}

/* ----------------------------------------------------- */

// 获取SKU模块数据列表 /admin/product/list/{page}/{limit} get
export const reqGetSkuList = (page, limit) => {
  return request({
    url: `/admin/product/list/${page}/${limit}`,
    method: "get",
  })
}

// sku模块的上架 /admin/product/onSale/{skuId} get
export const reqSkuOnSale = (skuId) => {
  return request({
    url: `/admin/product/onSale/${skuId}`,
    method: "get",
  })
}
// sku模块的下架 /admin/product/cancelSale/{skuId} get
export const reqSkuCancelSale = (skuId) => {
  return request({
    url: `/admin/product/cancelSale/${skuId}`,
    method: "get",
  })
}

// 获取sku详情的接口 /admin/product/getSkuById/{skuId} get
export const reqGetSkuDetailById = (skuId) => {
  return request({
    url: `/admin/product/getSkuById/${skuId}`,
    method: "get",
  })
}
